package day07_14.day12;

import java.util.*;

public class Main02 {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int num = scn.nextInt();
        ArrayList<Integer> arrayList = find(num);
        Map<Integer , Integer> map = new HashMap<>();
        int a = 0 , b = 0;
        int count = 0;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < arrayList.size(); i++) {
            for (int j = 0; j < arrayList.size(); j++) {
                if (arrayList.get(i) + arrayList.get(j) == num){
                   count = Math.abs(arrayList.get(i) - arrayList.get(j));
                   if (min > count ){
                       min = count;
                       a = arrayList.get(i);
                       b = arrayList.get(j);
                   }
                }
            }
        }
        System.out.println(Math.min(a , b));
        System.out.println(Math.max(a , b));
    }
    public static ArrayList<Integer> find(int num){
        ArrayList<Integer> arrayList = new ArrayList<>();
        for (int i = 2; i < num - 1; i++) {
            if (isOr(i)){
                arrayList.add(i);
            }
        }
        return arrayList;
    }
    public static boolean isOr(int n){
        for (int i = 2; i < n / 2; i++) {
            if (n / i == 0){
                return false;
            }
        }
        return true;
    }

}
